import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;

public final class o {

    public static boolean a = false;
    public String b;
    public int c;
    public int d;
    public int e;
    public g f;
    public ch g;
    public at h;
    public g i;
    public Font j;
    public Font k;
    public Font l;
    public Font m;
    public int n;
    public int o;
    public int p;
    public int q;
    public u r;
    public u s;
    public u t;
    public u u;
    public int v;
    public int w;
    public int x;
    public int y;
    public o z;
    public g A;

    public o(String s1) {
        f = g.a;
        g = ch.f;
        h = at.a;
        i = g.a;
        b = s1;
        a();
    }

    public o(String s1, o o1) {
        this(s1);
        if (o1 != null) {
            c = o1.c;
            d = o1.d;
            e = o1.e;
            f = o1.f;
            g = o1.g;
            h = o1.h;
            i = o1.i;
            j = o1.j;
            k = o1.k;
            l = o1.l;
            m = o1.m;
            n = o1.n;
            o = o1.o;
            p = o1.p;
            q = o1.q;
            r = o1.r;
            s = o1.s;
            t = o1.t;
            u = o1.u;
            v = o1.v;
            w = o1.w;
            x = o1.x;
            y = o1.y;
        }
    }

    public final void a() {
        f = g.a;
        g = ch.f;
        h = at.a;
        i = g.a;
        j = k = l = m = Font.getDefaultFont();
        r = null;
        s = null;
        t = null;
        u = null;
        z = null;
        A = null;
    }

    public final int a(int i1) {
        switch (i1) {
            case 0: // '\0'
                return n;

            case 1: // '\001'
                return o;

            case 2: // '\002'
                return p;

            case 3: // '\003'
                return q;
        }
        return 0;
    }

    public final int b(int i1) {
        switch (i1) {
            case 0: // '\0'
                return v;

            case 1: // '\001'
                return w;

            case 2: // '\002'
                return x;

            case 3: // '\003'
                return y;
        }
        return 0;
    }

    public final Font c(int i1) {
        switch (i1) {
            case 0: // '\0'
                return j;

            case 1: // '\001'
                return k;

            case 2: // '\002'
                return l;

            case 3: // '\003'
                return m;
        }
        return null;
    }

    public final u d(int i1) {
        switch (i1) {
            case 0: // '\0'
                return r;

            case 1: // '\001'
                return s;

            case 2: // '\002'
                return t;

            case 3: // '\003'
                return u;
        }
        return null;
    }

    public final g b() {
        if (A == null) {
            int i1 = f.b + ((g) (g)).b + i.b;
            int j1 = f.c + ((g) (g)).c + i.c;
            int k1 = f.d + ((g) (g)).d + i.d;
            int l1 = f.e + ((g) (g)).e + i.e;
            A = new g(i1, j1, k1, l1);
        }
        return A;
    }

    public final int c() {
        return b().b;
    }

    public final int d() {
        return b().c;
    }

    public final int e() {
        return b().d;
    }

    public final int f() {
        return b().e;
    }

    public final int g() {
        return b().a();
    }

    public final int h() {
        return b().b();
    }

    private o j() {
        if (z != null)
            return z;
        else
            return this;
    }

    public final o a(boolean flag) {
        if (flag)
            return j();
        else
            return this;
    }

    public final void a(ba ba1, Graphics g1, int i1, int j1, boolean flag) {
        int k1 = i1 - f.a();
        int l1 = j1 - f.b();
        g1.translate(f.b, f.d);
        g.a(ba1, this, g1, k1, l1);
        g1.translate(((g) (g)).b, ((g) (g)).d);
        k1 -= g.a();
        l1 -= g.b();
        h.a(g1, k1, l1);
        g1.translate(i.b, i.d);
        if (a) {
            g1.setColor(255);
            g1.setStrokeStyle(0);
            int i2 = f.b + ((g) (g)).b + i.b;
            int j2 = f.d + ((g) (g)).d + i.d;
            g1.drawRect(-i2, -j2, i1 - 1, j1 - 1);
            g1.setStrokeStyle(0);
        }
        if (flag) {
            k1 -= i.a();
            l1 -= i.b();
            g1.clipRect(0, 0, k1, l1);
        }
    }

    private static int e(int i1) {
        int j1 = i1 & 0xfffffff2;
        i1 &= 0xd;
        switch (i1) {
            case 1:
                break;
            case 8:
                i1 = j1 | 4;
                break;
            case 4:
                i1 = j1 | 8;
                break;
        }
        return i1;
    }

    public final void i() {
        e = e(e);
        h.g = e(h.g);
        if ("menu2".equals(b) || "submenu2".equals(b))
            h.g |= 0x200;
        if (z != null)
            z.i();
    }

    public final void a(bs bs1) {
        if (g == ch.f)
            g = new ch(3);
        else
            g.g = 3;
        g.j = bs1;
        h.b = 0;
    }

}